<template>
  <div class="home-item">
    <div class="item-inner">
      <div class="cover">
        <img :src="itemData.image.url" alt="">
      </div>
      <div class="info">
        <div class="summary">{{itemData.summaryText}}</div>
        <div class="name">{{itemData.houseName}}</div>
        <div class="news">
          <van-rate :model-value="Number(itemData.commentScore)" color="#fff" readonly allow-half/>
          <div class="price">{{itemData.finalPrice}}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
defineProps({
  itemData:{
    type: Object,
    default: () => ({})
  }
})

</script>

<style lang='less' scoped>
.home-item{
  width: 50%;
  .item-inner{
    position: relative;
    margin: 5px;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    .cover{
      img{
        width: 100%;
        height: 200px;
      }
    }
  }
}
.info{
  position: absolute;
  top: 145px;
  color: #fff;
  width: 100%;
  .name{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .news{
    display: flex;
    justify-content: space-around;
    .price{
      line-height: 20px;
    }
  }
}
</style>